https://glot.io/snippets/gicdclun5d/raw/main.lua